import Vue from 'vue'
import VueRouter from 'vue-router'

import TopicParadise from "@/views/topicParadise/route.js"
import PreferentialActivities from "@/views/preferentialActivities/route.js"
import PlayAllParadise from "@/views/playAllParadise/route.js"
import AboutUs from "@/views/aboutUs/route.js"
import OnlineBooking from "@/views/onlineBooking/route.js"
import MyOrder from "@/views/myOrder/route.js"

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component: () => import(/* webpackChunkName:"aboutUs" */ '@/views/aboutUs/KnowUs.vue') // 路由懒加载
  },
  ...TopicParadise,
  ...PreferentialActivities,
  ...PlayAllParadise,
  ...AboutUs,
  ...OnlineBooking,
  ...MyOrder,
  {
    path: '/manageSystemTicketInfo',
    name: 'manageSystemTicketInfo',
    component: () => import(/* webpackChunkName:"manageSystem" */ '@/views/manageSystem/ticketInfo.vue'), // 路由懒加载
    meta: { title: '门票信息' }
  },
  {
    path: '/manageSystemCardInfo',
    name: 'manageSystemCardInfo',
    component: () => import(/* webpackChunkName:"manageSystem" */ '@/views/manageSystem/cardInfo.vue'), // 路由懒加载
    meta: { title: '年卡信息' }
  },
  {
    path: '/manageSystemUsers',
    name: 'manageSystemUsers',
    component: () => import(/* webpackChunkName:"manageSystem" */ '@/views/manageSystem/userInfo.vue'), // 路由懒加载
    meta: { title: '账号信息' }
  },
  {
    path: '/manageSystemTicketOrder',
    name: 'manageSystemTicketOrder',
    component: () => import(/* webpackChunkName:"manageSystem" */ '@/views/manageSystem/ticketOrder.vue'), // 路由懒加载
    meta: { title: '门票订单信息' }
  },
  {
    path: '/manageSystemCardOrder',
    name: 'manageSystemCardOrder',
    component: () => import(/* webpackChunkName:"manageSystem" */ '@/views/manageSystem/cardOrder.vue'), // 路由懒加载
    meta: { title: '年卡订单信息' }
  },
  {
    path: '*',
    redirect: '/' // 重定向
  },
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
